import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/components/Index'    //首页
import ProductDetails from '@/components/ProductDetails'  //商品详情
import circumstance from "@/components/circumstance.vue" //商品详情
import appraise from "@/components/appraise.vue" //商品评论

// import Classification from '@/components/Classification'  //分类
// import ShopCar from '@/components/ShopCar'  //购物车
// import Mine from '@/components/Mine'        //我的
// import AllOrders from '@/components/AllOrders'  //全部订单
// import PersonalData from '@/components/PersonalData'  //个人资料
// import AddressManagement from '@/components/AddressManagement'  //地址管理
// import BoundPhone from '@/components/BoundPhone'  //绑定手机
// import ModifyPassword from '@/components/ModifyPassword'    //修改密码
// import MyCollection from '@/components/MyCollection'  //我的收藏
// import ConfirmOrder from '@/components/ConfirmOrder'  //确认订单
// import ReceiptAddress from '@/components/ReceiptAddress'  //收货地址
// import Login from '@/components/Login'  //登录
// import Registered from '@/components/Registered'  //注册
// import AddReceiptAddress from '@/components/AddReceiptAddress'  //新增收货地址
// import Search from '@/components/Search'  //搜索页面
// import Accounts from '@/components/Accounts'  //订单结束
// import commodity from "@/components/commodity.vue"  //商品信息
// import Screen from '@/components/Screen'  //筛选

const PersonalData = r => require.ensure([], () => r(require('@/components/PersonalData.vue')), 'PersonalData');
const AddressManagement = r => require.ensure([], () => r(require('@/components/AddressManagement.vue')), 'AddressManagement');
const BoundPhone = r => require.ensure([], () => r(require('@/components/BoundPhone.vue')), 'BoundPhone');
const ModifyPassword = r => require.ensure([], () => r(require('@/components/ModifyPassword.vue')), 'ModifyPassword');
const MyCollection = r => require.ensure([], () => r(require('@/components/MyCollection.vue')), 'MyCollection');
const ConfirmOrder = r => require.ensure([], () => r(require('@/components/ConfirmOrder.vue')), 'ConfirmOrder');
const Screen = r => require.ensure([], () => r(require('@/components/Screen.vue')), 'Screen');
const commodity = r => require.ensure([], () => r(require('@/components/commodity.vue')), 'commodity');
const Search = r => require.ensure([], () => r(require('@/components/Search.vue')), 'Search');
const Accounts = r => require.ensure([], () => r(require('@/components/Accounts.vue')), 'Accounts');
const AddReceiptAddress = r => require.ensure([], () => r(require('@/components/AddReceiptAddress.vue')), 'AddReceiptAddress');
const ReceiptAddress = r => require.ensure([], () => r(require('@/components/ReceiptAddress.vue')), 'ReceiptAddress');
const AllOrders = r => require.ensure([], () => r(require('@/components/AllOrders.vue')), 'AllOrders');
const Classification = r => require.ensure([], () => r(require('@/components/Classification.vue')), 'Classification');
const ShopCar = r => require.ensure([], () => r(require('@/components/ShopCar.vue')), 'ShopCar');
const Mine = r => require.ensure([], () => r(require('@/components/Mine.vue')), 'Mine');
const Login = r => require.ensure([], () => r(require('@/components/Login.vue')), 'Login');
const Registered = r => require.ensure([], () => r(require('@/components/Registered.vue')), 'Registered');








Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',                        //首页
      name: 'index/:id',
      component: Index
    },{
      path: '/Classification',          //分类
      name: 'Classification',
      component: Classification
    },{
      path: '/ShopCar',                 //购物车
      name: 'ShopCar',
      component: ShopCar
    },{
      path: '/Mine',                    //我的
      name: 'Mine',
      meta:{
        requireAuth: true
      },
      component: Mine
    },{
      path: '/AllOrders',               //全部订单
      name: 'AllOrders',
      component: AllOrders
    },{
      path: '/PersonalData',            //个人资料
      name: 'PersonalData/:gid',
      component: PersonalData
    },{
      path: '/AddressManagement',       //地址管理
      name: 'AddressManagement',
      component: AddressManagement
    },{
      path: '/BoundPhone',              //绑定手机
      name: 'BoundPhone',
      component: BoundPhone
    },{
      path: '/ModifyPassword',          //修改密码
      name: 'ModifyPassword',
      component: ModifyPassword
    },{
      path: '/MyCollection',            //我的收藏
      name: 'MyCollection',
      component: MyCollection
    },{
      path: '/ProductDetails',          //商品详情
      name: 'ProductDetails',
      component: ProductDetails
    },{
      path: '/ConfirmOrder',            //确认订单
      name: 'ConfirmOrder',
      meta:{
        requireAuth: true
      },
      component: ConfirmOrder
    },{
      path: '/ReceiptAddress',          //收货地址
      name: 'ReceiptAddress',
      meta: {
        requireAuth: true
      },

      component: ReceiptAddress
    },{
      path: '/Login',                   //登录
      name: 'Login',
      component: Login
    },{
      path: '/Registered',              //注册
      name: 'Registered',
      component: Registered
    },{
      path: '/AddReceiptAddress',       //新增收货地址
      name: 'AddReceiptAddress',
      meta: {
        requireAuth: true
      },

      component: AddReceiptAddress
    },{
      path: '/Search',                  //搜索
      name: 'Search/:kwords',
      component: Search
    },{
      path: '/Accounts',                  //订单结束
      name: 'Accounts',
      component: Accounts
    },{
      path: '/Screen',                  //筛选
      name: 'Screen',
      component: Screen
    }
  ]
})
